{template 'admin','header'}
<form action="{$self_url}?action=edit{if isset($_GET['site_id'])}&site_id={$_GET['site_id']}{/if}" method="POST" onsubmit="return r_submit(this);">
<table cellspacing="1" cellpadding="2" class="table_list">
<caption>站点配置管理</caption>
<tr><th>配置项</th><th>值</th>{if check_perms('siteconf_del')==true}<th>删除</th>{/if}</tr>
{loop $list $key $res}
	{if $key=='ANNOUNCE_TYPE'}
	{php $ann_list = explode(',', $res)}
		<tr>
			<td>{$key}</td>
			<td>{if check_perms('siteconf_edit')==true}
			{get $sql="select * from edufe_type where parentcode='announce_type' and status=99"}
			<input type="checkbox" {if in_array($r['tcode'], $ann_list)}checked{/if} name="value[{$key}][]" value="{$r['tcode']}">{$r['tname']}&nbsp;
			{/get}
				{else}
					{$res}
				{/if}
			</td>
			{if check_perms('siteconf_del')==true}<td><a href="javascript:my_request('{$self_url}?action=del&key={$key}{if isset($_GET['site_id'])}&site_id={$_GET['site_id']}{/if}','确认要删除吗？')">删除</a></td>{/if}
		</tr>
	{else}
		<tr>
			<td>{$key}</td>
			<td>{if check_perms('siteconf_edit')==true}<input type="text" name="value[{$key}]" value="{$res}">{else}{$res}{/if}</td>
			{if check_perms('siteconf_del')==true}<td><a href="javascript:my_request('{$self_url}?action=del&key={$key}{if isset($_GET['site_id'])}&site_id={$_GET['site_id']}{/if}','确认要删除吗？')">删除</a></td>{/if}
		</tr>
	{/if}
{/loop}
</table>
<div class="button_box">
{if check_perms('siteconf_edit')==true}<input type="submit" value="修改" class="button_style">{/if}&nbsp;{if check_perms('siteconf_add')==true}<input class="button_style" onclick="self.location='{$self_url}?action=add{if isset($_GET['site_id'])}&site_id={$_GET['site_id']}{/if}&forward={$forward}'" type="button" value="添加配置">{/if}
</div>
</form>
{template 'admin','footer'}